cmake_minimum_required(VERSION 2.8.12)

project(CmakeQt LANGUAGES CXX)
#set(Qt5_DIR "/home/liuqiang/Qt5.10.1/5.10.1/gcc_64/lib/cmake/Qt5")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)


#set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

find_package(Qt5 COMPONENTS core gui widgets sql REQUIRED)


qt5_wrap_ui(ui_FILES mainwindow.ui)

add_executable(${PROJECT_NAME} "main.cpp" "mainwindow.h" "mainwindow.cpp"  "widget.h" "widget.cpp"  ${ui_FILES})

target_link_libraries(${PROJECT_NAME}  Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Sql)